﻿<?php
if(!defined('IN_PHPSCUP'))exit('hacking'); 
class DefaultApp extends BaseApp
{
    function index()
    { 
	    $setlang = '';
		if(isset($_GET['langid']))
		{
	    $setlang = $_GET['langid']; 		
		}

        if(!empty($setlang))
		{
				  if(preg_match("/[.\/]/",$setlang))
		          {
		            $GLOBALS['Lang']->_lang_tp = LANG;
		  
                  } 
				  else
				  {
				  $GLOBALS['Lang']->_lang_tp = $setlang;				  
				  }
		          $GLOBALS['Lang']->_set_lang($GLOBALS['Lang']->_lang_tp);
		}
		$GLOBALS['Lang']->_get_lang('default');	
		
		require(ROOT_PATH . '/lib/nav.lib.php');
		
		$nav = new Nav($GLOBALS['SCup']->SCup_nav_file);
		
        $this->assign('navigation', $nav->_get_nav());	

	 	$categorydata = & $GLOBALS['SCup']->_get_category_data('prot');
		
        $this->assign('categorydata', $categorydata);			

        $qq_data = array();
        $qq_temp1 = del_empty_var(explode('|', QQ_SET_DATA));
		foreach($qq_temp1 as $key=>$value)
		{
           $qq_temp2 = del_empty_var(explode(':', $value));	
		   $qq_data[$qq_temp2[0]] = $qq_temp2[1];     
		}
        $this->assign('qq_data',$qq_data);	
		
		$TB_new = &$this->_model('new');				
		$data_index_new = $TB_new->inindex();		
        $this->assign('data_index_new', $data_index_new);		

		$TB_job = &$this->_model('job');				
		$data_index_job = $TB_job->inindex();		
        $this->assign('data_index_job', $data_index_job);	
		
		$TB_prot = &$this->_model('prot');				
		$data_index_prot = $TB_prot->inindex();		
        $this->assign('data_index_prot', $data_index_prot);				
		
		
        $pic_data = include(ROOT_PATH . '/data/cache/rollpic_'.trim($GLOBALS['Lang']->_lang_tp).'.php'); 
		$this->assign('pic_data', $pic_data);

        $link_data = include(ROOT_PATH . '/data/cache/links_'.trim($GLOBALS['Lang']->_lang_tp).'.php'); 
		$this->assign('link_data', $link_data);
	    
        $this->assign('view_charset', VIEW_CHARSET);
        $this->assign('langdata', $GLOBALS['Lang']->_get_lang_typesdata());	 	
        $this->assign('langtype', trim($GLOBALS['Lang']->_lang_tp));
						
        $this->assign('site_url', SITE_URL);
				
        $this->assign('page_title', SITE_TITLE);
        $this->assign('page_description', SITE_DESCRIPTION);
        $this->assign('page_keywords', SITE_KEYWORDS);
		$this->assign('bg_pic_url',$GLOBALS['SCup']->SCup_name.'/view/'.VIEW_TYPE .'/style/'.CSS_TYPE.'/');
        $this->assign('login_icon', $GLOBALS['SCup']->SCup_user_checking);		

		
        $this->display('index.view.html');
    }
  
    function yzimage()
    {		
      include(ROOT_PATH ."/lib/image.lib.php");
      $string_yzimg=check_rand(4);
      setcookie(COOKIE_PREFIX."yzImgNum",$string_yzimg);
	  $GLOBALS['SCup']->SCup_user_msg['data']['yzImgNum'] = $string_yzimg; 

      Image:: check_img($string_yzimg); 
    }	
   
}






?>